﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

public partial class userbackstage : System.Web.UI.Page
{
    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString.ToString());
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["name"] == null)
        {
            Response.Redirect("login.aspx");
        }
        else
        {
            if (System.Data.ConnectionState.Closed == conn.State)
            {
                conn.Open();
            }
            string dl = "insert into logindate (name,date) values ('" + Session["name"] + "','" + DateTime.Now + "')";
            SqlCommand comm1 = new SqlCommand(dl, conn);
            comm1.ExecuteNonQuery();
        }
    }
}